package org.dromara.system.domain.bo;

import org.dromara.system.domain.SysProfitRule;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.hibernate.validator.constraints.Length;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;

import java.util.Date;
import java.io.Serial;
import java.io.Serializable;

/**
 * 分佣规则业务对象 sys_profit_rule
 *
 * @author yixiacoco
 * @date 2025-09-04
 */
@Data
@AutoMapper(target = SysProfitRule.class, reverseConvertGenerate = false)
public class SysProfitRuleBo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 规则id
     */
    @NotBlank(message = "规则id不能为空", groups = {EditGroup.class})
    @Length(max = 36, message = "规则id不能大于{max}个字符", groups = {EditGroup.class})
    private String ruleId;
    /**
     * 规则名称
     */
    @NotBlank(message = "规则名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Length(max = 100, message = "规则名称不能大于{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String ruleName;
    /**
     * 规则描述
     */
    private String ruleDescription;
    /**
     * 规则类型（percentage/fixed）
     */
    @NotBlank(message = "规则类型（percentage/fixed）不能为空", groups = {AddGroup.class, EditGroup.class})
    @Length(max = 20, message = "规则类型（percentage/fixed）不能大于{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String ruleType;
    /**
     * 分佣金额（固定金额）
     */
    private BigDecimal profitFormula;
    /**
     * 一级分佣百分比
     */
    private BigDecimal oneProfitPercentage;
    /**
     * 二级分佣百分比
     */
    private BigDecimal twoProfitPercentage;
    /**
     * 三级分佣百分比
     */
    private BigDecimal threeProfitPercentage;
}
